<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="application/msexcel" %>
<!-- 以上这行设定本网页为excel格式的网页 -->
<%
   response.setHeader("Content-disposition","inline; filename=test1.xls");
/*    下载的方式： response.setHeader("Content-disposition","attachment; filename=test2.xls");  */
   //以上这行设定传送到前端浏览器时的档名为test1.xls
   //就是靠这一行，让前端浏览器以为接收到一个excel档 
%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>行为记录表导出Excel</title>
    
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
	<link rel="stylesheet" href="<%=basePath%>../css/index.css"/>
   <title>Excel档案呈现方式(行为记录表)</title>
  
  
  </head>
  
  <body>
  <table border="1">
  	<caption class="cap">行为记录表</caption>
    <tr class="info">
	      <th>序号</th>
	      <th>姓名</th>
	      <th>类别</th>
	      <th>规程编号</th>
	      <th>条款号</th>
	      <th>条款内容</th>
	      <th>行为情况</th>
	      <th>日期</th>
	      <th>严重度</th>
	      <th>记录人</th>
	      <th>计划处罚金额</th>
	      <th>已交处罚金额</th>
	      <th>备注说明</th>
	     <%-- <th>其他2</th>
	      <th>其他3</th>--%>
    </tr>
    <c:forEach items="${requestScope.behavior}" var="be">
   
    <tr>
    	<td width="3%">${be.id}</td>
    	<td width="5%">${be.bname}</td>
    	<td width="5%">${be.bType}</td>
    	<td width="5%">${be.code}</td>
    	<td width="5%">${be.regular}</td>
    	<td width="5%">${be.bContent}</td>
    	<td width="5%">${be.bCondition}</td>
    	<td width="5%">${be.bDate}</td>
    	<td width="3%">${be.servious}</td>
    	<td width="4%">${be.people}</td>
    	<td width="3%">${be.coin}</td>
    	<td width="5%">${be.others1}</td>
		<td width="5%">${be.remark}</td>
    <%--	<td width="5%">${be.others2}</td>
    	<td width="5%">${be.others3}</td>--%>
    </tr>
    </c:forEach>
  </table>
  
  </body>
</html>
